<?php

require '../conn.php';

require 'config.php';

require '../inc/function.php';

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<title></title>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<link rel="stylesheet" href="../css/admin.css" type="text/css" />

<script type="text/javascript" src="inc/function.js"></script>

<script type="text/javascript" src="../fy_ckeditor/ckeditor.js"></script>

</head>

<body>

<?php

if ($act=='modify'){

 
 	$n_title=ReStra(trim($_POST['n_title']));
	$n_url=ReStra(trim($_POST['n_url']));

	$n_image=ReStra(trim($_POST['n_image']));
  
 
 
	$sql="update ".$language."_links set 

 
	n_title='$n_title',

 	n_image='$n_image',
	n_url='$n_url'
 
	 where n_id=$id";

	mysql_query($sql) or die(mysql_error($sql));

	Msg('','links.php?'.$urls);

}

$query=mysql_query('select * from '.$language.'_links where n_id='.$id);

$row=mysql_fetch_array($query);

?>

<div id="container">

  <div class="edit">

      <h1>伙伴管理<a href="javascript:location.reload();">刷新</a>޸</h1>

      <form name="form1" method="post" action="?act=modify&<?php echo $urls.'&id='.$id ?>" onsubmit="return CheckNews(this);">

        <table width="100%" border="0" cellpadding="0" cellspacing="0">

          
          <tr>

            <td class="edit_title">伙伴标题：</td>

            <td><input type="text" name="n_title" class="inputtext" value="<?php echo $row['n_title'] ?>" size="80" maxlength="255" /></td>

          </tr>

 <tr>

            <td class="edit_title">缩略伙伴：</td>

            <td><input type="text" name="n_image" id="n_image" class="inputtext" size="50"   value="<?php echo $row['n_image'] ?>"/>
            &nbsp;(最大尺寸：200x60)
            <iframe src="../upload_fy.php?file_type=0&file_id=n_image" frameborder="0" allowtransparency="true" scrolling="no" width="100%" height="25"></iframe></td>

          </tr>
          
          
                
                  <tr>

            <td class="edit_title">外链地址：</td>

            <td><input type="text" name="n_url" class="inputtext" size="100" value="<?php echo $row['n_url'] ?>" maxlength="255" /></td>

          </tr>
          
          
          <tr>

            <td class="edit_title" height="30">&nbsp;</td>

			<td><input type="submit" name="button" class="button" value=" 保存 " />&nbsp;&nbsp;<input type="button" name="button" class="button" value=" 返回 " onclick="location.href='links.php?<?php echo $urls ?>';" /></td>

          </tr>

        </table>

    </form>

	<script type="text/javascript">

	document.form1.n_class.value="<?php echo $row['n_class'] ?>";

	</script>

    </div>

</div>

</body>

</html>